<!DOCTYPE html>
<html>
<head>
    <title> {$site_info.site_name|default=''}</title>
    <meta name="keywords" content="{$site_info.site_seo_keywords|default=''}"/>
    <meta name="description" content="{$site_info.site_seo_description|default=''}">
    <include file="public@head"/>
    <!--<hook name="before_head_end"/>-->
    <style>
        .jianjie{
            color: #9d9d9e;
            line-height: 20px;
            font-size: 13px;
            margin-top: 10px;
        }
        .timeAdd {
            font-size: 13px;
            color: #9d9d9e;
        }
        .box-cont .author {
            float: right;
        }

    </style>
</head>
<body class="page-index">
<div class="container">
    <include file="public@nav"/>

    <div class="contents">
        <!--活动通知/公告-->
        <div class="activity voluntTrain forum">
            <div class="title">
                <ul class="news-title">
                    <li class="title-item active"><a href="javascript:;">论坛热帖</a></li>
                </ul>
            </div>
            <div class="box-cont voluntSty">
                <div class="act-forenotice">
                    <form class="layui-form" action="">
                        <div class="layui-form-item">
                            <div class="layui-input-inline">
                                <select name="cate" class="select"  lay-verify="required">
                                    <option value="">分类查询</option>
                                    <foreach name="category" id="vo" key="k">
                                    <option value="{$k}" {$cate_id==$k?'selected="selected"':''}>{$vo}</option>
                                   </foreach>
                                </select>
                            </div>

                            <!--<div class="layui-input-inline">-->
                                <!--<input type="text" class="layui-input" id="time" placeholder="时间查询" readonly>-->
                            <!--</div>-->
                            <div class="layui-input-inline">
                                <button class="layui-btn" lay-submit lay-filter="formDemo">查询</button>
                            </div>
                            <div class="layui-input-inline tjTz" style="float: right;width: 105px;">
                                <a href="{:url('portal/forum/article_add')}"><button type="button" class="layui-btn"><i class="layui-icon layui-icon-add-circle-fine"></i> 新建帖子</button></a>
                            </div>
                            <div style="clear: both;"></div>
                        </div>
                    </form>


                    <div class="notice">
                        <php>
                            $where= function($query){
                            $query->where('post.create_time','egt',0);
                            };
                            $page=[
                            'list_rows'=>10,
                            'next'=>'下一页',
                            'prev'=>'上一页'
                            ];
                        </php>
                        <widget name="last_articles">
                            <portal:articles  order="post.published_time DESC"  page="$page"
                                              categoryIds="$category_list">
                        <div class="blockSty">

                            <a href="{:url('portal/forum/detail',array('id'=>$vo['id']))}">
                                <div>
                                    <img src="/html/img/list.png" class="listImg">
                                    <div class="blockTitle">【{$vo.categories[0]['name']}】{$vo.post_title}</div>
                                    <div style="clear: both;"></div>
                                </div>
                                <div class="jianjie">
                                    {$vo.post_excerpt}
                                </div>
                            </a>
                            <div class="timeAdd">
                                <!--<button type="button" class="layui-btn">{$vo.post_like}</button>-->
                                <i class="layui-icon layui-icon-praise"></i> {$vo.post_like}喜欢     &nbsp;&nbsp;
                                <i class="layui-icon layui-icon-dialogue"></i> {$vo.comment_count}评论
                                <text class="jgSty"></text>
                                <i class="layui-icon layui-icon-log"></i> {$vo.create_time|date="Y-m-d H:i:s"}
                                <text class="jgSty"></text>
                                <i class="layui-icon layui-icon-fire"></i> {$vo.post_hits}点击
                                <div class="author">作者：{$vo.user.user_nickname}</div>
                                <div style="clear: both;"></div>
                            </div>

                        </div>
                            </portal:articles>

                        </widget>
                    </div>
                    <ul class="pagination">
                        <page/>
                    </ul>
                    <!--<div id="listOne"></div>-->
                </div>
            </div>
        </div>
        <div style="clear: both;"></div>
    </div>


    <include file="public@footer"/>
    <!-- /container -->
    <include file="public@scripts"/>
    <script>
        layui.use('form', function(){
            var form = layui.form;

            //监听提交
            form.on('submit(formDemo)', function(data){
                //layer.msg(JSON.stringify(data.field.cate));
                window.location='{:url('/forum')}'
                //return false;
            });
        });


        (function($){
            "use strict";

            $(function(){
                $('.layui-quote-nm li img').hover(function(){$(this).MaxScaleLarge()},function(){$(this).MaxScaleSmall()});
            })
        })(jQuery);

        //    layui
        layui.use(['laypage', 'layer','form','laydate'], function() {
            var laypage = layui.laypage
                    , layer = layui.layer
                    ,form = layui.form
                    ,laydate = layui.laydate;
//        分页
            laypage.render({
                elem: 'listOne'
                ,count: 100
                ,layout: ['prev', 'page', 'next', 'skip' ,'count']
                ,prev: '<em>←</em>'
                ,next: '<em>→</em>'
                ,jump: function(obj){
                    console.log(obj)
                }
            });

//        时间选择
            //日期时间选择器
            laydate.render({
                elem: '#time'
                ,type: 'datetime'
            });
            laydate.render({
                elem: '#timeTwo'
                ,type: 'datetime'
            });
        });
    </script>
    <hook name="before_body_end"/>
</body>
</html>